'use strict'

const Controller = require('egg').Controller
const Joi = require('@hapi/joi')
const _ = require('lodash')
const uuidv4 = require('uuid/v4')

class OssController extends Controller {
  async SendVerify() {
    const { ctx, service } = this
    const { smsService } = service
    try {
      const params = ctx.joi({
        mobile: Joi.string().required()
      })
      const smsRes = await smsService.SendCaptcha(params.mobile)
      if (smsRes !== true) throw smsRes
      ctx.success(true)
    } catch (error) {
      ctx.fail(error)
    }
  }
}

module.exports = OssController
